package com.cws.web;



import java.io.Serializable;

public class ReponseData implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	//正确
	public static final ReponseData SUCCESS= new ReponseData(true);
	//错误
	public static final ReponseData FAILURE= new ReponseData(false);
	
	private boolean status;
	private String message;
	private Object data;
	public boolean isStatus() {
		return status;
	}
	public void setStatus(boolean status) {
		this.status = status;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	public ReponseData() {
	}
	
	public ReponseData(boolean status) {
		super();
		this.status = status;
	}
	
	public ReponseData(boolean status,String message) {
		super();
		this.status = status;
		this.message = message;
	}
	
	public ReponseData(boolean status, String message, Object data) {
		super();
		this.status = status;
		this.message = message;
		this.data = data;
	}
	
	public static ReponseData createSuccess(Object data) {
        return new ReponseData(true, null, data);
    }
	
	public static ReponseData createSuccess(String message) {
        return new ReponseData(true, message);
    }
	
    public static ReponseData createFailure(String message) {
        return new ReponseData(false, message);
    }
}
